package com.credit.management.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.management.system.custom.dao.CSyauthorityMapper;
import com.credit.management.system.generator.dao.SyauthorityMapper;
import com.credit.management.system.model.Syauthority;
import com.credit.management.system.service.ISyauthorityService;
@Service
public class SyauthorityService implements ISyauthorityService {
	@Autowired
	private CSyauthorityMapper cSyauthorityMapper;
	@Autowired
	private SyauthorityMapper syauthorityMapper;
	/**
	 * 根据用户id查询权限
	 */
	@Override
	public List<Map<String,Object>> findSyauthoritysByUserId(Integer userId) {
		
		return cSyauthorityMapper.findSyauthoritysByUserId(userId);
	}
	/**
	 * 查询所有的syauthority（权限）
	 */
	@Override
	public List<Map<String, Object>> findAllSyauthoritys() {
		
		return cSyauthorityMapper.findAllSyauthoritys();
	}
	/**
	 * 根据id删除syauthority
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
	
		return syauthorityMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段插入syauthority
	 */
	@Override
	public int insertSelective(Syauthority syauthority) {
		
		return syauthorityMapper.insertSelective(syauthority);
	}
	/**
	 * 根据id查询syauthority
	 */
	@Override
	public Syauthority selectByPrimaryKey(Integer id) {
		
		return syauthorityMapper.selectByPrimaryKey(id);
	}
	/**
	 * 选择字段修改syauthority
	 */
	@Override
	public int updateByPrimaryKeySelective(Syauthority syauthority) {
		
		return syauthorityMapper.updateByPrimaryKeySelective(syauthority);
	}

}
